package com.liuyc.lib.ui.viewpager2.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * viewpager2  默认使用的 adapter
 */
open class DefaultFragmentStateAdapter(activity: FragmentActivity, var fragmentList: MutableList<Fragment>) : FragmentStateAdapter(activity) {

    override fun getItemCount(): Int {
        return fragmentList.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragmentList.get(position)
    }

}